import request from '@/router/request'
const baseUrl = "/api";

// 登录方法
export function login(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: baseUrl + '/login',
    method: 'post',
    data: data
  })
}

// 账密登录
export function pwdlogin(data) {
  return request({
    url: baseUrl + '/oauth/token',
    headers: {
      Authorization: 'Basic YXBwOmFwcA=='
    },
    method: 'post',
    params: data
  })
}

// 退出方法
export function logout() {
  return request({
    url: baseUrl + '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: baseUrl + '/captchaImage',
    method: 'get'
  })
}
